﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SWENAssignment.Classes;

namespace SWENAssignment
{
    public partial class customerCheckOut : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnSearch_Click(object sender, EventArgs e)
        {
            CheckInPage u = DBmanager.GetDataByID(tbxBookingID.Text);
            if (u != null)
            {
                lblRoomLevel.Text = Convert.ToString(u.RoomLevel);
                lblRoomNumber.Text = u.RoomNum;
                lblRoomCat.Text = u.RoomCategory;
                lblCheckInDate.Text = Convert.ToString(u.CheckInDate);
                lblCheckOutDate.Text = Convert.ToString(u.CheckOutDate);
                lblNumberOfRooms.Text = Convert.ToString(u.NumOfRooms);
                
            }

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            Payment pm = new Payment();
            pm.LastName = tbxLastName.Text;
            pm.FirstName = tbxFirstName.Text;
            pm.TotalPrice = Convert.ToDecimal(TextBox1.Text);
            pm.CreditCardNum = Convert.ToInt32(tbxCreditCardNumber.Text);
            pm.PaymentType = ddlPaymentType.Text;
            pm.ExpiryDate = Convert.ToDateTime(ddlDate.Text + ddlMnth.Text + tbxYear.Text);

            int row = DBmanager.CreatePayment(pm);

        }
    }
}